package com.springboot.astra.bean;

import java.io.Serializable;
import java.util.List;

public class User implements Serializable {
    private Integer userId;
    private String userAccount;
    private String userName;
    private String userPwd;
    private String userEmail;
    private String userPhone;
    private boolean isDelete;
    private String createTime;
    private String userImg;
    private Integer points;
    private List<Role> roles;
    private List<Permission> permissions;

    public User() {
    }

    public User(Integer userId, String userAccount, String userName, String userPwd, String userEmail, String userPhone, boolean isDelete, String createTime, String userImg, Integer points, List<Role> roles, List<Permission> permissions) throws Exception {
        this.userId = userId;
        this.userAccount = userAccount;
        this.userName = userName;
        this.userPwd = userPwd;
        this.userEmail = userEmail;
        this.userPhone = userPhone;
        this.isDelete = isDelete;
        this.createTime = createTime;
        this.userImg = userImg;
        this.points = points;
        this.roles = roles;
        this.permissions = permissions;
//        toStringRole();
    }

//    private void toStringRole() throws Exception{
//        for (Role role: this.roles) {
//            this.roleStr= this.roleStr+role.getRoleName()+' ';
//        }
//    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getUserEmail() {
        return userEmail;
    }

    public void setUserEmail(String userEmail) {
        this.userEmail = userEmail;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserAccount() {
        return userAccount;
    }

    public void setUserAccount(String userAccount) {
        this.userAccount = userAccount;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserPwd() {
        return userPwd;
    }

    public void setUserPwd(String userPwd) {
        this.userPwd = userPwd;
    }

    public boolean isDelete() {
        return isDelete;
    }

    public void setDelete(boolean delete) {
        isDelete = delete;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUserImg() {
        return userImg;
    }

    public void setUserImg(String userImg) {
        this.userImg = userImg;
    }

    public Integer getPoints() {
        return points;
    }

    public void setPoints(Integer points) {
        this.points = points;
    }

    public List<Permission> getPermissions() {
        return permissions;
    }

    public void setPermissions(List<Permission> permissions) {
        this.permissions = permissions;
    }

}
